﻿<UserControl x:Class="Spenta.StreetCare.Silverlight.UserControls.FilterByStatusUserControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
    xmlns:ViewModels="clr-namespace:Spenta.StreetCare.Silverlight.MVVM.ViewModels" xmlns:UserControls="clr-namespace:Spenta.StreetCare.Silverlight.UserControls" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="252">

    <UserControl.Resources>
        <ViewModels:StatusViewModel x:Key="StatusViewModel" />
    </UserControl.Resources>

    <ItemsControl ItemsSource="{Binding StatusesWithCount}" DataContext="{StaticResource StatusViewModel}" d:DataContext="{d:DesignData /SampleData/StatusViewModelSampleData.xaml}" Width="252">
        <ItemsControl.ItemsPanel>
            <ItemsPanelTemplate>
                <StackPanel/>
            </ItemsPanelTemplate>
        </ItemsControl.ItemsPanel>
        <ItemsControl.ItemTemplate>
            <DataTemplate>
                <Grid Style="{StaticResource FilterToolBarGrid}">
                    <StackPanel Margin="0" Orientation="Horizontal">
                        <UserControls:WaitUserControl Foreground="Orange" IsMoving="{Binding IsDirty}" Padding="0,0,10,0" Margin="5,0,10,0" />
                        <Border HorizontalAlignment="Center" Height="15" Margin="0,3,8,0" VerticalAlignment="Top" Width="15" CornerRadius="3" Background="Black" >
                            <Image Source="{Binding StatusImageUrl}" />
                        </Border>
                        <StackPanel>
                            <HyperlinkButton  Command="{Binding Source={StaticResource StatusViewModel}, Path=FilterByStatusCommand}" CommandParameter="{Binding StatusID}" Content="{Binding StatusTitle}" Style="{StaticResource ToolbarLinkLabel}" />
                            <StackPanel Orientation="Horizontal">
                                <dataInput:Label Content="{Binding ReportCount}" Style="{StaticResource ToolbarLinkCaption}" />
                                <dataInput:Label Margin="5,0,0,0" Content="{Binding Literals.Reports, Source={StaticResource StatusViewModel}}" Style="{StaticResource ToolbarLinkCaption}" />
                            </StackPanel>
                        </StackPanel>
                    </StackPanel>
                </Grid>
            </DataTemplate>
        </ItemsControl.ItemTemplate>
    </ItemsControl>
</UserControl>
